darwin.libcxx: (╯°□°)╯︵ ┻━┻#398727
Merged
emilazy merged 11 commits intoNixOS:stagingfrom Sep 15, 2025
Merged
Conversation
edac098 to
34d2d14
Compare
bc18c00 to
d111455
Compare
d111455 to
7411df7
Compare
7411df7 to
e18b37b
Compare
Contributor
Author
|
Fixed the signatures. I think I’m going to need to look into Sequoia as a replacement for GnuPG …. Anyway, I confirmed that all of the packages changed in this PR build except for servo, which fails due to having |
e18b37b to
34c076c
Compare
34c076c to
02a2048
Compare
13 tasks
13 tasks
2 tasks
02a2048 to
8e5554e
Compare
088c7a6 to
996bbf6
Compare
Adds the headers and text-based stubs for the system libc++. This package is using the newest available version (currently 15.5) because libc++ uses static availability checks to prevent using features not supported by older deployment targets. Co-authored-by: Emily <vcs@emily.moe>
This reverts commit 04b49f4. This workaround has a non-trivial cost in build time. Since it’s not needed when linking against the system libc++, just drop it.
We now use the latest SDK’s libc++ headers, and longer have Clang versions old enough for version compatibility to be a concern.
Darwin now uses the system libc++ by default, so drop the replacement. The nixpkgs libc++ is not ABI-compatible with the system libc++, so this replacement was not guaranteed to work anyway. See: https://discourse.llvm.org/t/apples-libc-now-provides-std-type-descriptor-t-functionality-not-found-in-upstream-libc/73881/3
The libc++ in nixpkgs is not ABI-compatible with the system libc++, so replacements are not guaranteed to work. See: https://discourse.llvm.org/t/apples-libc-now-provides-std-type-descriptor-t-functionality-not-found-in-upstream-libc/73881/3
996bbf6 to
b5bbaf2
Compare
Contributor
|
Woohoo! |
Rhys-T
added a commit
to Rhys-T/nur-packages
that referenced
this pull request
Oct 13, 2025
Reworked patch into a setup hook shared between phosg and resource_dasm. Made the patch slightly less hacky. Re-enabled patch when libc++ is Apple's version rather than LLVM's. (See <NixOS/nixpkgs#398727>.)
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Darwin currently uses libc++ from nixpkgs, but it probably shouldn’t (at least not by default). The libc++ that is built in nixpkgs comes from LLVM. According to Louis Dionne (of Apple and a member of the C++ committee), the libc++ shipped by Apple should be considered distinct from the libc++ in LLVM. We’ve been lucky that we have not had problems with ODR violations. This PR was prompted by leakage of symbols from the system libc++ that started happening with the release of macOS 15.4. It changes a number of things to improve the compatibility of C++ on Darwin.
Testing
I also confirmed that all of the packages updated in this PR built (except for servo, which is broken due to Darwin having a case-insensitive build location), that Qt 5 and opencv4 built on x86_64-darwin, and that my configs built (except for util-linux, which appears broken again on Darwin).
Breaking Change
The primary points of breakage are as follows:
libcxxshould instead referencestdenv.cc.libcxx. (Those are also fixed in this PR.)overrideLibcxxdoesn’t work with the system libc++. If you really need to use it, you should use it withllvmPackages.libcxxStdenv.Notes about fixed packages
/usr/local/lib. Fixed in #399005.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.